package org.example.DesignPatterns.Factory.OperationFactory;

/**
 * @description:
 * @author: farprt
 * @create: 2022-03-09 22:03
 **/
public class OperationFactory {
    public static Operation createOperate(String operate){
        Operation operation=null;
        switch (operate){
            case "+":
                operation=new OperationAdd();
                break;
            case "-":
                operation=new OperationSub();
                break;
            case "*":
                operation=new OperationMul();
                break;
            case "/":
                operation=new OperationDiv();
                break;
        }
        return operation;
    }
}